<link rel="stylesheet" type="text/css" href="/static/plugins/editormd/css/editormd.min.css">
<link rel="stylesheet" href="/static/plugins/form-selects/form-selects.v4.css">
<div class="layui-card layadmin-tabs-card">
    <div class="layui-card-header">
        <span class="layui-breadcrumb">
            <a href="/management/index">首页</a>
            <!--suppress HtmlUnknownAnchorTarget -->
            <a href="#/note">笔记管理</a>
            <a><cite>编辑随笔</cite></a>
        </span>
    </div>
</div>
<div class="layui-fluid layadmin-container" id="NB-note-edit-tab">
    <div class="layui-row">
        <div id="article-post" class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-header layui-elip">修改你的笔记</div>
                <div class="layui-card-body">
                    <div class="layui-form">
                        <input type="hidden" th:value="${editNote.id}" name="id">
                        <input type="hidden" th:value="${editNote.show}" name="show">
                        <input type="hidden" th:value="${editNote.top}" name="top">
                        <input type="hidden" th:value="${#temporals.format(editNote.post, 'yyyy-MM-dd HH:mm:ss')}"
                               name="post">
                        <div class="layui-form-item layui-col-sm8">
                            <label class="layui-form-label">标题</label>
                            <div class="layui-input-block">
                                <input type="text" name="title" required lay-verify="required" placeholder="请输入标题"
                                       th:value="${editNote.title}"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">内容</label>
                            <div class="layui-input-block" id="content-editor" style="max-width: 1366px;">
                                <textarea id="editormd-markdown-doc" name="editormd-markdown-doc"
                                          style="display:none;"></textarea>
                                <textarea id="editormd-html-code" name="editormd-html-code"
                                          style="display:none;"></textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-sm8">
                            <label class="layui-form-label">标签</label>
                            <div class="layui-input-block">
                                <select name="tagNames"
                                        xm-select="tags"
                                        xm-select-max="4"
                                        xm-select-search=""
                                        xm-select-create=""
                                        xm-select-search-type="dl">
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="noteSubmit">立即发布</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:inline="javascript">
    var mdNoteContent = [[${editNote.mdContent}]];
    var noteId = [[${editNote.id}]]
</script>

